import { getCategoryApi } from "@/apis/index.js";
import { CategoryItem } from "@/types/index.js";
import { defineStore } from "pinia";


export const useCategoryStore = defineStore('category', {
  state: (): {list : CategoryItem[]} => ({
    list: []
  }),
  actions: {
    async getCategoryList() {
      const res =  await getCategoryApi()
      this.list = res.categorys;
    },
  }
});
